﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_LayoutShow.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   DTcms.Model.orders m = ViewData["model"] as DTcms.Model.orders;
   ViewBag.Title = "查看订单 - " + site.name;
}

<div class="section clearfix">
  <div class="line30"></div>
  <div class="info-wrap">
    <!--右侧内容-->
    <div class="home-box">
      <!--查看订单-->
      <div class="u-tab-head">
        <p>
          <a href="@bc.linkurl("userorder","list")">交易订单</a>
          <a href="@bc.linkurl("userorder","close")">已关闭订单</a>
        </p>
      </div>
      <div class="u-tab-content">
        <div class="title-div">
          <strong>查看订单</strong>
        </div>
        
        @if(m.status<4){
        <div class="step-box @(m.payment_status > 0 ? "" : "mini")">
          <ul>
            <!--下单-->
            <li class="first done">
              <div class="progress"><span class="text">下单</span></div>
              <div class="info">@m.add_time</div>
            </li>
            <!--/下单-->
            
            @if(m.payment_status>0){
            <!--付款-->
            <li class="@(m.payment_status==2?"done":"")">
              <div class="progress"><span class="text">付款</span></div>
              <div class="info">@(m.payment_status==2 ? ((DateTime)m.payment_time).ToString("yyyy-MM-dd") : "")</div>
            </li>
            <!--/付款-->
            }
            
            <!--确认-->
            <li class="@(m.status >= 2 ? "done" : "")">
              <div class="progress"><span class="text">确认</span></div>
              <div class="info">@(m.status >= 2 ? ((DateTime)m.confirm_time).ToString("yyyy-MM-dd") : "")</div>
            </li>
            <!--/确认-->
            
            <!--发货-->
            <li class="@(m.express_status == 2 ? "done" : "")">
              <div class="progress"><span class="text">发货</span></div>
              <div class="info">@(m.express_status == 2 ? ((DateTime)m.express_time).ToString("yyyy-MM-dd") : "")</div>
            </li>
            <!--发货-->
            
            <!--完成-->
            <li class="last @(m.status > 2 ? "done" : "")">
              <div class="progress"><span class="text">完成</span></div>
              <div class="info">@(m.status > 2 ? ((DateTime)m.complete_time).ToString("yyyy-MM-dd") : "")</div>
            </li>
            <!--完成-->
          </ul>
        </div>
        <div class="line20"></div>
        }

        <div class="form-box accept-box">
          <dl class="head">
            <dd>
              订单号：@m.order_no
              @if(bc.get_order_payment_status(m.id)){
              <a class="btn-pay" href="@bc.linkurl("payment","?action=confirm&order_no="+ m.order_no)">去付款</a>
              }
            </dd>
          </dl>
          <dl>
            <dt>订单状态：</dt>
            <dd>@bc.get_order_status(m.id)</dd>
          </dl>
          @if(m.payment_status>0){
          <dl>
            <dt>支付方式：</dt>
            <dd>@bc.get_payment_title(m.payment_id)</dd>
          </dl>
          }
          @if(m.express_status==2){
          <dl>
            <dt>发货单号：</dt>
            <dd>@bc.get_express_title(m.express_id) @m.express_no</dd>
          </dl>
          }
        </div>
              
        <div class="line10"></div>
        <table width="100%" border="0" cellspacing="0" cellpadding="5" class="ftable">
          <tr>
            <th align="left" colspan="2">商品信息</th>
            <th width="10%">单价</td>
            <th width="10%">积分</th>
            <th width="10%">数量</th>
            <th width="10%">金额</th>
            <th width="10%">积分</th>
          </tr>
          @if(m.order_goods!=null){
          foreach(DTcms.Model.order_goods mt in m.order_goods){
          <tr>
            <td width="60">
              <a target="_blank" href="@bc.linkurl("goods_show",@mt.article_id)">
                <img src="@bc.get_article_img_url(mt.article_id)" class="img" />
              </a>
            </td>
            <td align="left">
              <a target="_blank" href="@bc.linkurl("goods_show",mt.article_id)">@mt.goods_title</a>
              <p>@mt.spec_text</p>
            </td>
            <td align="center">
              <s>￥@mt.goods_price</s>
              <p>￥@mt.real_price</p>
            </td>
            <td align="center">@(mt.point > 0 ? "+" : "")@mt.point</td>
            <td align="center">@mt.quantity</td>
            <td align="center">￥@(mt.real_price*mt.quantity)</td>
            <td align="center">@(mt.point*mt.quantity)</td>
          </tr>
          }
          }else{
          <tr><td colspan="7" align="center">暂无记录</td></tr>
          }
          <tr>
            <td colspan="7" align="right">
              <p>商品金额：<b class="red">￥@m.real_amount</b>&nbsp;&nbsp;+&nbsp;&nbsp;运费：<b class="red">￥@m.express_fee</b>&nbsp;&nbsp;+ &nbsp;&nbsp;支付手续费：<b class="red">￥@m.payment_fee</b>&nbsp;&nbsp;税费：<b class="red">@m.invoice_taxes</b></p>
              <p style="font-size:22px;">应付总金额：<b class="red">￥@m.order_amount</b></p>
            </td>
          </tr>
        </table>
        
        <div class="line10"></div>
        <div class="form-box accept-box">
          <dl class="head">
            <dd>收货信息</dd>
          </dl>
          <dl>
            <dt>顾客姓名：</dt>
            <dd>@m.accept_name</dd>
          </dl>
          <dl>
            <dt>送货地址：</dt>
            <dd>@m.area @m.address @m.post_code</dd>
          </dl>
          <dl>
            <dt>联系电话：</dt>
            <dd>@m.mobile @m.telphone</dd>
          </dl>
          <dl>
            <dt>电子邮箱：</dt>
            <dd>@m.email</dd>
          </dl>
          <dl>
            <dt>备注留言：</dt>
            <dd>@m.message</dd>
          </dl>
          <dl>
            <dt>开具发票：</dt>
            <dd>@(m.is_invoice == 1 ? "是" : "否")</dd>
          </dl>
          @if(@m.is_invoice==1){
          <dl>
            <dt>发票抬头：</dt>
            <dd>@m.invoice_title</dd>
          </dl>
          }
        </div>
        
      </div>
      <!--/查看订单-->
    </div>
    <!--/右侧内容-->
  </div>
</div>